package com.clouddms;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.cache.annotation.EnableCaching;

/**
 * Cloud-DMS 云存储数据管理系统启动类
 *
 * @author Cloud-DMS Team
 * @version 1.0.0
 */
@SpringBootApplication
@EnableJpaRepositories(basePackages = "com.clouddms.repository")
@EntityScan(basePackages = "com.clouddms.entity")
@EnableScheduling  // 启用定时任务支持（备份模块需要）
@EnableAsync       // 启用异步支持（文件上传下载异步处理）
@EnableCaching     // 启用缓存支持
public class CloudDmsApplication {

    public static void main(String[] args) {
        // 设置应用程序名称（在任务管理器中显示）
        System.setProperty("spring.application.name", "CloudDMS-FileManager-Dev");
        
        // 启动Spring Boot应用
        SpringApplication app = new SpringApplication(CloudDmsApplication.class);
        app.run(args);

        // 启动日志
        System.out.println("\n" +
                "  ______ _                 _   _____  __  __  _____ \n" +
                " / ____|| |___  _   _  __| | |  __ \\|  \\/  |/ ____|\n" +
                "| |     | / _ \\| | | |/ _` | | |  | | |\\/| | (___  \n" +
                "| |     | | (_)| |_| | (_| | | |  | | |  | |\\___ \\ \n" +
                " \\______|_|\\___/\\__,_|\\__,_| |_____/|_|  |_|_____/ \n" +
                "\n" +
                ":: CloudDMS File Manager [DEV] ::         (v1.0.0)\n" +
                ":: 文件管理系统已启动! 访问: http://localhost:8080 ::\n");
    }
}